package com.yaodian100.ec.order.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;

import com.yaodian100.core.common.entity.BaseEntity;

@Entity
@Table(name = "EC_ORDER_MAIN_HISTORY")
@NamedQueries( { @NamedQuery(name = "OrderHistory.getByOrderId", query = "select orderSt, modifyUser, modifyDate "
		+ "from OrderHistory " + "where orderId = :orderId " + "order by modifyDate desc") })
public class OrderHistory extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "OID")
	private String oid;
	@Column(name = "order_id", length = 13)
	private String orderId;
	@Column(name = "order_st", length = 5, nullable = false)
	private String orderSt = "00";
	@Column(name = "amount", columnDefinition = "numeric(10,2)")
	private BigDecimal amount = BigDecimal.ZERO;
	@Column(name = "b2e_id", length = 20)
	private String b2eId;
	@Column(name = "benefit", columnDefinition = "numeric(10,2)")
	private BigDecimal benefit = BigDecimal.ZERO;
	@Column(name = "bonus", columnDefinition = "numeric(10,2)")
	private BigDecimal bonus = BigDecimal.ZERO;
	@Column(name = "cash", columnDefinition = "numeric(10,2)")
	private BigDecimal cash = BigDecimal.ZERO;
	@Column(name = "channel", length = 100, nullable = false)
	private String channel;
	@Column(name = "channel_seq", nullable = false)
	private int channelSeq;
	@Column(name = "client_ip", length = 100, nullable = false)
	private String clientIp;
	/** coupon, 使用 coupon 面額 */
	@Column(name = "coupon", columnDefinition = "numeric(10,2)")
	private BigDecimal coupon = BigDecimal.ZERO;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "deadline", nullable = false)
	private Date deadline;
	/** discount, 折扣金額 sum(orderProduct.discount) */
	@Column(name = "discount", columnDefinition = "numeric(10,2)")
	private BigDecimal discount = BigDecimal.ZERO;
	@Column(name = "from_city", length = 20)
	private String fromCity = " ";
	@Column(name = "from_district", length = 20)
	private String fromDistrict = " ";
	@Column(name = "from_province", length = 20)
	private String fromProvince = " ";
	@Column(name = "invoice_addr", length = 100)
	private String invoiceAddr = " ";
	@Column(name = "invoice_area", length = 20)
	private String invoiceArea = " ";
	@Column(name = "invoice_city", length = 20)
	private String invoiceCity = " ";
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "invoice_dt")
	private Date invoiceDt;
	@Column(name = "invoice_number", length = 30)
	private String invoiceNumber = " ";
	@Column(name = "invoice_province", length = 20)
	private String invoiceProvince = " ";
	@Column(name = "invoice_title", length = 50)
	private String invoiceTitle = " ";
	@Column(name = "invoice_tp", length = 5, nullable = false)
	private String invoiceTp = "01";
	@Column(name = "invoice_zip", length = 10)
	private String invoiceZip = " ";
	@Column(name = "is_campaign")
	private boolean isCampaign = false;
	@Column(name = "is_sync")
	private boolean isSync = false;
	@Column(name = "login_id", length = 100, nullable = false)
	private String loginId;
	@Column(name = "member_id", length = 10, nullable = false)
	private String memberId;
	@Column(name = "member_name", length = 100, nullable = false)
	private String memberName;
	@Column(name = "memo", length = 300)
	private String memo;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "order_dt", nullable = false)
	private Date orderDt;
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "payment_dt")
	private Date paymentDt;
	@Column(name = "payment_id", length = 20)
	private String paymentId;
	@Column(name = "payment_src", length = 20)
	private String paymentSrc = " ";
	@Column(name = "payment_st", length = 5, nullable = false)
	private String paymentSt = "00";
	@Column(name = "payment_tp", length = 5, nullable = false)
	private String paymentTp;
	@Column(name = "receiver_addr", length = 100)
	private String receiverAddr = "";
	@Column(name = "receiver_area", length = 20)
	private String receiverArea = "";
	@Column(name = "receiver_city", length = 20)
	private String receiverCity = "";
	@Column(name = "receiver_email", length = 100)
	private String receiverEmail = "";
	@Column(name = "receiver_ext", length = 10)
	private String receiverExt = "";
	@Column(name = "receiver_mobile", length = 20)
	private String receiverMobile = "";
	@Column(name = "receiver_name", length = 20)
	private String receiverName = "";
	@Column(name = "receiver_phone_area", length = 10)
	private String receiverPhoneArea = "";
	@Column(name = "receiver_phone", length = 20)
	private String receiverPhone = "";
	@Column(name = "receiver_province", length = 20)
	private String receiverProvince = "";
	@Column(name = "receiver_tp", length = 5, nullable = false)
	private String receiverTp = "10";
	@Column(name = "receiver_zip", length = 10)
	private String receiverZip = "";
	@Column(name = "return_benefit", columnDefinition = "numeric(10,2)")
	private BigDecimal returnBenefit = BigDecimal.ZERO;
	@Column(name = "return_bonus", columnDefinition = "numeric(10,2)")
	private BigDecimal returnBonus = BigDecimal.ZERO;
	@Column(name = "return_Coupon", columnDefinition = "numeric(10,2)")
	private BigDecimal returnCoupon = BigDecimal.ZERO;
	@Column(name = "return_cash", columnDefinition = "numeric(10,2)")
	private BigDecimal returnCash = BigDecimal.ZERO;
	@Column(name = "return_my_wallet", columnDefinition = "numeric(10,2)")
	private BigDecimal returnMyWallet = BigDecimal.ZERO;
	@Column(name = "returnBenefit", columnDefinition = "numeric(10,2)")
	private BigDecimal returnShipfare = BigDecimal.ZERO;
	@Column(name = "return_total_price", columnDefinition = "numeric(10,2)")
	private BigDecimal returnTotalPrice = BigDecimal.ZERO;
	@Column(name = "shipfare", columnDefinition = "numeric(10,2)")
	private BigDecimal shipfare = BigDecimal.ZERO;
	@Column(name = "total_price", columnDefinition = "numeric(10,2)")
	private BigDecimal totalPrice = BigDecimal.ZERO;
	@Column(name = "sync_date")
	private Date syncDt;
	@Column(name = "camp_product_limit", columnDefinition = "numeric(10,2)")
	private BigDecimal campProductLimit = BigDecimal.ZERO;
	@Column(name = "VERSION", length = 14)
	private String version;

	private Date modifyDateForView;

	public String getOid() {
		return this.oid;
	}

	public void setOid(String oid) {
		this.oid = oid;
	}

	public String getOrderId() {
		return this.orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public String getOrderSt() {
		return this.orderSt;
	}

	public void setOrderSt(String orderSt) {
		this.orderSt = orderSt;
	}

	public Date getModifyDateForView() {
		return this.modifyDateForView;
	}

	public void setModifyDateForView(Date modifyDateForView) {
		this.modifyDateForView = modifyDateForView;
	}

	public BigDecimal getAmount() {
		return this.amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	public String getB2eId() {
		return this.b2eId;
	}

	public void setB2eId(String b2eId) {
		this.b2eId = b2eId;
	}

	public BigDecimal getBenefit() {
		return this.benefit;
	}

	public void setBenefit(BigDecimal benefit) {
		this.benefit = benefit;
	}

	public BigDecimal getBonus() {
		return this.bonus;
	}

	public void setBonus(BigDecimal bonus) {
		this.bonus = bonus;
	}

	public BigDecimal getCash() {
		return this.cash;
	}

	public void setCash(BigDecimal cash) {
		this.cash = cash;
	}

	public String getChannel() {
		return this.channel;
	}

	public void setChannel(String channel) {
		this.channel = channel;
	}

	public int getChannelSeq() {
		return this.channelSeq;
	}

	public void setChannelSeq(int channelSeq) {
		this.channelSeq = channelSeq;
	}

	public String getClientIp() {
		return this.clientIp;
	}

	public void setClientIp(String clientIp) {
		this.clientIp = clientIp;
	}

	public BigDecimal getCoupon() {
		return this.coupon;
	}

	public void setCoupon(BigDecimal coupon) {
		this.coupon = coupon;
	}

	public Date getDeadline() {
		return this.deadline;
	}

	public void setDeadline(Date deadline) {
		this.deadline = deadline;
	}

	public BigDecimal getDiscount() {
		return this.discount;
	}

	public void setDiscount(BigDecimal discount) {
		this.discount = discount;
	}

	public String getFromCity() {
		return this.fromCity;
	}

	public void setFromCity(String fromCity) {
		this.fromCity = fromCity;
	}

	public String getFromDistrict() {
		return this.fromDistrict;
	}

	public void setFromDistrict(String fromDistrict) {
		this.fromDistrict = fromDistrict;
	}

	public String getFromProvince() {
		return this.fromProvince;
	}

	public void setFromProvince(String fromProvince) {
		this.fromProvince = fromProvince;
	}

	public String getInvoiceAddr() {
		return this.invoiceAddr;
	}

	public void setInvoiceAddr(String invoiceAddr) {
		this.invoiceAddr = invoiceAddr;
	}

	public String getInvoiceArea() {
		return this.invoiceArea;
	}

	public void setInvoiceArea(String invoiceArea) {
		this.invoiceArea = invoiceArea;
	}

	public String getInvoiceCity() {
		return this.invoiceCity;
	}

	public void setInvoiceCity(String invoiceCity) {
		this.invoiceCity = invoiceCity;
	}

	public Date getInvoiceDt() {
		return this.invoiceDt;
	}

	public void setInvoiceDt(Date invoiceDt) {
		this.invoiceDt = invoiceDt;
	}

	public String getInvoiceNumber() {
		return this.invoiceNumber;
	}

	public void setInvoiceNumber(String invoiceNumber) {
		this.invoiceNumber = invoiceNumber;
	}

	public String getInvoiceProvince() {
		return this.invoiceProvince;
	}

	public void setInvoiceProvince(String invoiceProvince) {
		this.invoiceProvince = invoiceProvince;
	}

	public String getInvoiceTitle() {
		return this.invoiceTitle;
	}

	public void setInvoiceTitle(String invoiceTitle) {
		this.invoiceTitle = invoiceTitle;
	}

	public String getInvoiceTp() {
		return this.invoiceTp;
	}

	public void setInvoiceTp(String invoiceTp) {
		this.invoiceTp = invoiceTp;
	}

	public String getInvoiceZip() {
		return this.invoiceZip;
	}

	public void setInvoiceZip(String invoiceZip) {
		this.invoiceZip = invoiceZip;
	}

	public boolean isCampaign() {
		return this.isCampaign;
	}

	public void setCampaign(boolean isCampaign) {
		this.isCampaign = isCampaign;
	}

	public boolean isSync() {
		return this.isSync;
	}

	public void setSync(boolean isSync) {
		this.isSync = isSync;
	}

	public String getLoginId() {
		return this.loginId;
	}

	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}

	public String getMemberId() {
		return this.memberId;
	}

	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}

	public String getMemberName() {
		return this.memberName;
	}

	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}

	public String getMemo() {
		return this.memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public Date getOrderDt() {
		return this.orderDt;
	}

	public void setOrderDt(Date orderDt) {
		this.orderDt = orderDt;
	}

	public Date getPaymentDt() {
		return this.paymentDt;
	}

	public void setPaymentDt(Date paymentDt) {
		this.paymentDt = paymentDt;
	}

	public String getPaymentId() {
		return this.paymentId;
	}

	public void setPaymentId(String paymentId) {
		this.paymentId = paymentId;
	}

	public String getPaymentSrc() {
		return this.paymentSrc;
	}

	public void setPaymentSrc(String paymentSrc) {
		this.paymentSrc = paymentSrc;
	}

	public String getPaymentSt() {
		return this.paymentSt;
	}

	public void setPaymentSt(String paymentSt) {
		this.paymentSt = paymentSt;
	}

	public String getPaymentTp() {
		return this.paymentTp;
	}

	public void setPaymentTp(String paymentTp) {
		this.paymentTp = paymentTp;
	}

	public String getReceiverAddr() {
		return this.receiverAddr;
	}

	public void setReceiverAddr(String receiverAddr) {
		this.receiverAddr = receiverAddr;
	}

	public String getReceiverArea() {
		return this.receiverArea;
	}

	public void setReceiverArea(String receiverArea) {
		this.receiverArea = receiverArea;
	}

	public String getReceiverCity() {
		return this.receiverCity;
	}

	public void setReceiverCity(String receiverCity) {
		this.receiverCity = receiverCity;
	}

	public String getReceiverEmail() {
		return this.receiverEmail;
	}

	public void setReceiverEmail(String receiverEmail) {
		this.receiverEmail = receiverEmail;
	}

	public String getReceiverExt() {
		return this.receiverExt;
	}

	public void setReceiverExt(String receiverExt) {
		this.receiverExt = receiverExt;
	}

	public String getReceiverMobile() {
		return this.receiverMobile;
	}

	public void setReceiverMobile(String receiverMobile) {
		this.receiverMobile = receiverMobile;
	}

	public String getReceiverName() {
		return this.receiverName;
	}

	public void setReceiverName(String receiverName) {
		this.receiverName = receiverName;
	}

	public String getReceiverPhoneArea() {
		return this.receiverPhoneArea;
	}

	public void setReceiverPhoneArea(String receiverPhoneArea) {
		this.receiverPhoneArea = receiverPhoneArea;
	}

	public String getReceiverPhone() {
		return this.receiverPhone;
	}

	public void setReceiverPhone(String receiverPhone) {
		this.receiverPhone = receiverPhone;
	}

	public String getReceiverProvince() {
		return this.receiverProvince;
	}

	public void setReceiverProvince(String receiverProvince) {
		this.receiverProvince = receiverProvince;
	}

	public String getReceiverTp() {
		return this.receiverTp;
	}

	public void setReceiverTp(String receiverTp) {
		this.receiverTp = receiverTp;
	}

	public String getReceiverZip() {
		return this.receiverZip;
	}

	public void setReceiverZip(String receiverZip) {
		this.receiverZip = receiverZip;
	}

	public BigDecimal getReturnBenefit() {
		return this.returnBenefit;
	}

	public void setReturnBenefit(BigDecimal returnBenefit) {
		this.returnBenefit = returnBenefit;
	}

	public BigDecimal getReturnBonus() {
		return this.returnBonus;
	}

	public void setReturnBonus(BigDecimal returnBonus) {
		this.returnBonus = returnBonus;
	}

	public BigDecimal getReturnCash() {
		return this.returnCash;
	}

	public void setReturnCash(BigDecimal returnCash) {
		this.returnCash = returnCash;
	}

	public BigDecimal getReturnMyWallet() {
		return this.returnMyWallet;
	}

	public void setReturnMyWallet(BigDecimal returnMyWallet) {
		this.returnMyWallet = returnMyWallet;
	}

	public BigDecimal getReturnShipfare() {
		return this.returnShipfare;
	}

	public void setReturnShipfare(BigDecimal returnShipfare) {
		this.returnShipfare = returnShipfare;
	}

	public BigDecimal getReturnTotalPrice() {
		return this.returnTotalPrice;
	}

	public void setReturnTotalPrice(BigDecimal returnTotalPrice) {
		this.returnTotalPrice = returnTotalPrice;
	}

	public BigDecimal getShipfare() {
		return this.shipfare;
	}

	public void setShipfare(BigDecimal shipfare) {
		this.shipfare = shipfare;
	}

	public BigDecimal getTotalPrice() {
		return this.totalPrice;
	}

	public void setTotalPrice(BigDecimal totalPrice) {
		this.totalPrice = totalPrice;
	}

	public Date getSyncDt() {
		return this.syncDt;
	}

	public void setSyncDt(Date syncDt) {
		this.syncDt = syncDt;
	}

	public BigDecimal getCampProductLimit() {
		return this.campProductLimit;
	}

	public void setCampProductLimit(BigDecimal campProductLimit) {
		this.campProductLimit = campProductLimit;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public BigDecimal getReturnCoupon() {
		return returnCoupon;
	}

	public void setReturnCoupon(BigDecimal returnCoupon) {
		this.returnCoupon = returnCoupon;
	}

}
